<template>
  <!--视频预览    一行3列的内容-->
  <v-list-item >
    <v-list-item-content v-for="(video,i) in videoData" :key="i">
      <video
          controls
          width=30%
          :src="videoData.at(i)">
      </video>
    </v-list-item-content>

  </v-list-item>
</template>

<script>
import axios from "axios";

export default {
  name: "AllVideos",
  data(){
    return{
      videoData:[
        require('@/videos/圣诞节.mp4'),
        require('@/videos/极光.mp4'),
        require('@/videos/美女与花朵.mp4'),
      ],
      resp:[],
    }
  },
  mounted() {
    //加载所有数据
    // this.loadVideo();
  },
  methods:{
    // url没确定 暂时用不到
    loadVideo(){
      axios.post('/main',{
        // 从登录界面获取id 但其实没必要不是吗?反正都是首页
        id:1
      }).then(res =>{
        this.resp = res.data;
        if(res.status == 200 ){
          console.log("输出response.data", res.data);
          this.videoData = res.data
          console.log(res,res.status,res.data);
        }
      }).catch(err=>{
        console.log(err.message);
      })
    },
  }
}
</script>

<style scoped>

</style>